<include file="Public:header"/>
<script type="text/javascript" src="__PUBLIC__/layer/laydate/laydate.js"></script>
<div id="main-content">
	<div id="top-alert" class="fixed alert alert-error" style="display: none;">
		<button class="close fixed" style="margin-top: 4px;">&times;</button>
		<div class="alert-content">警告内容</div>
	</div>
	<div id="main" class="main">
		<div class="main-title-h">
			<span class="h1-title"><a href="{:U('Article/type')}">文章类型</a> >></span> <span class="h1-title"><empty name="data">添加文章
			<else/>
			                                                                                                                   编辑文章
		</empty></span>
		</div>
		<div class="tab-wrap">
			<div class="tab-content">
				<form id="form" action="{:U('Article/typeEdit')}" method="post" class="form-horizontal" enctype="multipart/form-data">
					<div id="tab" class="tab-pane in tab">
						<div class="form-item cf">
							<table>
								<tr class="controls">
									<td class="item-label">类型标识 :</td>
									<td>
										<input type="text" class="form-control input-10x" name="name" value="{$data.name}">
									</td>
									<td class="item-note"></td>
								</tr>
								<tr class="controls">
									<td class="item-label">上层分类 :</td>
									<td>
										<select name="shang" class="form-control input-10x">
											<option value=""
											<eq name="data['shang']" value="">selected</eq>
											>顶级分类</option>
											<volist name="list" id="v">
												<option value="{$key}"
												<eq name="data['shang']" value="$key">selected</eq>
												>{$v}</option>
											</volist>
										</select></td>
									<td class="item-note"></td>
								</tr>
								<tr class="controls">
									<td class="item-label">类型标题 :</td>
									<td>
										<input type="text" class="form-control input-10x" name="title" value="{$data.title}">
									</td>
									<td class="item-note"></td>
								</tr>
								<tr class="controls">
									<td class="item-label">首页显示 :</td>
									<td><select name="index" class="form-control input-10x">
										<option value="1"
										<eq name="data.index" value="1">selected</eq>
										>显示                                        </option>
										<option value="0"
										<eq name="data.index" value="0">selected</eq>
										>不显示                                        </option>
									</select></td>
									<td class="item-note"></td>
								</tr>
								<tr class="controls">
									<td class="item-label">底部显示 :</td>
									<td><select name="footer" class="form-control input-10x">
										<option value="1"
										<eq name="data.footer" value="1">selected</eq>
										>显示                                        </option>
										<option value="0"
										<eq name="data.footer" value="0">selected</eq>
										>不显示                                        </option>
									</select></td>
									<td class="item-note"></td>
								</tr>
								<tr class="controls">
									<td class="item-label">文章内容 :</td>
									<td>
										<textarea name="content" class="form-control input-10x">{$data.content}</textarea>
									</td>
									<td class="item-note">用来单页显示</td>
								</tr>
								<tr class="controls">
									<td class="item-label">添加时间 :</td>
									<td>
										<input type="text" class="form-control  input-10x " name="addtime" value="{$data['addtime']|addtime}" onclick="laydate({istime: true, format: 'YYYY-MM-DD hh:mm:ss'})">
									</td>
									<td class="item-note"></td>
								</tr>
								<tr class="controls">
									<td class="item-label">编辑时间 :</td>
									<td>
										<input type="text" class="form-control  input-10x " name="endtime" value="{$data['endtime']|addtime}" onclick="laydate({istime: true, format: 'YYYY-MM-DD hh:mm:ss'})">
									</td>
									<td class="item-note"></td>
								</tr>
								<tr class="controls">
									<td class="item-label">排序 :</td>
									<td>
										<input type="text" class="form-control input-10x" name="sort" value="{$data.sort}">
									</td>
									<td class="item-note"></td>
								</tr>
								<tr class="controls">
									<td class="item-label">状态 :</td>
									<td><select name="status" class="form-control input-10x">
										<option value="1"
										<eq name="data.status" value="1">selected</eq>
										>可用                                            </option>
										<option value="0"
										<eq name="data.status" value="0">selected</eq>
										>禁用                                            </option>
									</select></td>
									<td class="item-note"></td>
								</tr>
								<tr class="controls">
									<td class="item-label"></td>
									<td>
										<div class="form-item cf">
											<button class="ajax-post btn submit-btn" id="submit" type="submit" target-form="form-horizontal">确 定</button>
											<a class="btn btn-return" href="{$Think.server.HTTP_REFERER}">返 回</a>
											<notempty name="data.id"><input type="hidden" name="id" value="{$data.id}"/>
											</notempty>
										</div>
									</td>
								</tr>
							</table>
						</div>
					</div>
				</form>
				<script type="text/javascript">
					//提交表单
					$('#submit').click(function () {
						$('#form').submit();
					});
				</script>
			</div>
		</div>
	</div>
</div>
<script type="text/javascript" src="__PUBLIC__/kindeditor/kindeditor-min.js"></script>
<script type="text/javascript">
	var editor;
	KindEditor.ready(function (K) {
		editor = K.create('textarea[name="content"]', {
			width: '500px',
			height: '250px',
			allowPreviewEmoticons: false,
			allowImageUpload: true,
			uploadJson: "{:U('Article/typeEdit','type=images')}",//图片上传后的处理地址
			items: [
				'source', 'fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold', 'italic', 'underline',
				'removeformat', '|', 'justifyleft', 'justifycenter', 'justifyright', 'insertorderedlist',
				'insertunorderedlist', '|', 'emoticons', 'image', 'link', 'fullscreen'],
			afterBlur: function () {
				this.sync();
			}
		});
	});
</script>
<include file="Public:footer"/>
<block name="script">
	<script type="text/javascript" charset="utf-8">
		//导航高亮
		highlight_subnav("{:U('Article/type')}");
	</script>
</block>